package first.chapter2.profile;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description: 类作用描述
 * @Author: ChenZhiXiang
 * @CreateDate: 2019/5/8 0008 16:59
 * @Version: 1.0
 */
public class ProfileMain {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.getEnvironment().setActiveProfiles("dev");
        context.register(ProfileConfig.class);
        context.refresh(); //3
        ProfileBean profileBean = context.getBean(ProfileBean.class);
        System.out.println(profileBean.getName());
    }
}
